package com.zmn.plat.services.impl.contract.payment.record;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.zmn.plat.model.entity.contract.payment.record.ContractPaymentRecord;
import com.zmn.plat.model.entity.contract.payment.record.ContractPaymentRecordQuery;
import com.zmn.plat.persistence.interfaces.contract.payment.record.ContractPaymentRecordDao;
import com.zmn.plat.services.interfaces.contract.payment.record.ContractPaymentRecordService;

@Service
public class ContractPaymentRecordServiceImpl implements ContractPaymentRecordService {

    @Resource
    ContractPaymentRecordDao contractPaymentRecordDao;

    @Override
    public ContractPaymentRecord findByKey(Integer relateId) {
        return contractPaymentRecordDao.findByKey(relateId);
    }

    @Override
    public List<ContractPaymentRecord> listPageByQuery(ContractPaymentRecordQuery query) {
        int count = countByQuery(query);
        query.setTotalCount(count);
        return contractPaymentRecordDao.listPageByQuery(query);
    }

    @Override
    public List<ContractPaymentRecord> listByQuery(ContractPaymentRecordQuery query) {
        return contractPaymentRecordDao.listByQuery(query);
    }

    @Override
    public List<ContractPaymentRecord> listAll() {
        return contractPaymentRecordDao.listAll();
    }

    @Override
    public Integer countByQuery(ContractPaymentRecordQuery query) {
        return contractPaymentRecordDao.countByQuery(query);
    }

    @Override
    public Integer updateByKey(ContractPaymentRecord contractPaymentRecord) {
        return contractPaymentRecordDao.updateByKey(contractPaymentRecord);
    }

    @Override
    public Integer insert(ContractPaymentRecord contractPaymentRecord) {
        return contractPaymentRecordDao.insert(contractPaymentRecord);
    }

    @Override
    public Integer deleteByKey(Integer relateId) {
        return contractPaymentRecordDao.deleteByKey(relateId);
    }

}